<?php

namespace App\Model\Ocean;

use App\Model\Model;
use App\Model\User\User;
use Hyperf\Database\Model\SoftDeletes;

/**
 * @property integer $id
 * @property integer $user_id
 * @property integer $ocean_rubbish_id
 * @property integer $create_time
 * @property integer $update_time
 * @property integer $delete_time
 * @property integer $clear_time
 */
class OceanUserRubbish extends Model
{
    use SoftDeletes;

    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'ocean_user_rubbish';

    public function OceanRubbish()
    {
        return $this->hasOne(OceanRubbish::class, 'id', 'ocean_rubbish_id');
    }

    protected $fillable = [
        'id',
        'user_id',
        'ocean_rubbish_id',
        'create_time',
        'update_time',
        'delete_time',
        'clear_time',
    ];

    public function User()
    {
        return $this->hasOne(User::class, 'uid', 'user_id');
    }
}
